<!--
 * @Descripttion:
 * @version:
 * @Author: bfn
 * @Date: 2020-03-02
 * @LastEditors: dudu
 * @LastEditTime: 2020-03-05 11:28:42
 -->
<template>
  <div class="btn-wrapper">
    <el-button v-for="(item,index) in btnConfig"
               size="mini"
               :type="item.type"
               :disabled="disabledItems.includes(item.name)"
               @click="handleClick(item)"
               :key="index">{{item.label}}</el-button>
  </div>
</template>

<script>
export default {
  name: 'btnWrapper',
  props: {
    btnConfig: {
      type: Array,
      default: () => []
    },
    disabledItems: {
      type: Array,
      default: () => []
    },
    owner: {
      type: Object,
      default: () => { }
    }
  },
  methods: {
    handleClick (item) {
      this.$emit('handleClick', this.owner, item)
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
